from django import forms
from google.appengine.ext.db import djangoforms
import models


class ProblemForm(djangoforms.ModelForm):
  name = forms.CharField(widget=forms.TextInput(attrs={'size': '80'}))
  categories = forms.CharField(widget=forms.TextInput(attrs={'size': '80'}))
  description = forms.CharField(widget=forms.Textarea(attrs={'rows': '10', 'cols': '80'}))
  examples = forms.CharField(widget=forms.Textarea(attrs={'rows': '10', 'cols': '80'}))
  skeleton = forms.CharField(widget=forms.Textarea(attrs={'rows': '10', 'cols': '80'}))
  tests = forms.CharField(widget=forms.Textarea(attrs={'rows': '10', 'cols': '80'}))
  other_tests = forms.CharField(widget=forms.Textarea(attrs={'rows': '10', 'cols': '80'}), required=False)
  solution = forms.CharField(widget=forms.Textarea(attrs={'rows': '20', 'cols': '80'}), required=False)

  class Meta:
    model = models.Problem
    exclude = ('author', 'created', 'modified')



